﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="XuLyDonDatHang.ascx.cs" Inherits="XuLyDonDatHang" %>
<style type="text/css">

    .style1
    {
        width: 800px;
    }
    .style3
    {
        width: 323px;
    }
    </style>
<table class="style1">
    <tr>
        <td align="right" style="font-size: large; color: #00CCFF" valign="middle">
            Tình trạng đơn hàng:</td>
        <td width="10px">
            &nbsp;</td>
        <td class="style3">
            <asp:DropDownList ID="DropTinhTrang" runat="server" Font-Bold="True" 
                Font-Size="Medium" ForeColor="#00CCFF" 
                onselectedindexchanged="DropTinhTrang_SelectedIndexChanged" Width="200px">
                <asp:ListItem Value="1">Chưa xử lí</asp:ListItem>
                <asp:ListItem Value="2">Đã xử lí</asp:ListItem>
                <asp:ListItem Value="3">Đang giao</asp:ListItem>
                <asp:ListItem Value="4">Hoàn tất</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
</table>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    CellPadding="4" DataSourceID="ObjectDataSource1" 
    EmptyDataText="Không có giá trị thỏa điều kiện cần tìm" ForeColor="#333333" 
    GridLines="None" Width="800px">
    <RowStyle BackColor="#EFF3FB" />
    <Columns>
        <asp:BoundField DataField="MaHD" HeaderText="MaHD" SortExpression="MaHD" />
        <asp:BoundField DataField="MaTV" HeaderText="MaTV" SortExpression="MaTV" />
        <asp:BoundField DataField="NgayDatHang" HeaderText="NgayDatHang" 
            SortExpression="NgayDatHang" />
        <asp:BoundField DataField="TriGia" HeaderText="TriGia" 
            SortExpression="TriGia" />
        <asp:CheckBoxField DataField="DaGiaoHang" HeaderText="DaGiaoHang" 
            SortExpression="DaGiaoHang" />
        <asp:BoundField DataField="NgayGiaoHang" HeaderText="NgayGiaoHang" 
            SortExpression="NgayGiaoHang" />
        <asp:BoundField DataField="DiaChiGH" HeaderText="DiaChiGH" 
            SortExpression="DiaChiGH" />
        <asp:BoundField DataField="PhiGH" HeaderText="PhiGH" SortExpression="PhiGH" />
        <asp:BoundField DataField="TinhTrang" HeaderText="TinhTrang" 
            SortExpression="TinhTrang" />
        <asp:BoundField DataField="MaNV" HeaderText="MaNV" SortExpression="MaNV" />
        <asp:TemplateField HeaderText="Xem chi tiết">
            <ItemTemplate>
                <asp:LinkButton ID="btnChiTiet" runat="server" 
                    CommandArgument='<%# Eval("MaHD") %>' Font-Size="Small" ForeColor="#0099FF" 
                    onclick="btnChiTiet_Click">Chi tiết</asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Phân công">
            <ItemTemplate>
                <asp:DropDownList ID="DropDownList1" runat="server" 
                    CssClass='<%# Eval("MaHD") %>' DataSourceID="ObjectDataSource3" 
                    DataTextField="TenNV" DataValueField="MaNV" Height="22px" 
                    onselectedindexchanged="DropDownList1_SelectedIndexChanged" Width="167px">
                    <asp:ListItem Value="-1">Chưa phân công</asp:ListItem>
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
                    SelectMethod="GetAllNhanVien" TypeName="BussinessObject.NhanVienController">
                </asp:ObjectDataSource>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#00CCFF" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <EditRowStyle BackColor="#2461BF" />
    <AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
    SelectMethod="GetAllHoaDon" TypeName="BussinessObject.HoaDonContronller">
    <SelectParameters>
        <asp:ControlParameter ControlID="DropTinhTrang" DefaultValue="-1" 
            Name="TinhTrang" PropertyName="SelectedValue" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<p style="font-size: large; color: #00CCFF; font-weight: bold">
    Chi tiết hóa đơn:</p>
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
    DataSourceID="ObjectDataSource2">
    <Columns>
        <asp:BoundField DataField="MaHD" HeaderText="MaHD" SortExpression="MaHD" />
        <asp:BoundField DataField="MaSach" HeaderText="MaSach" 
            SortExpression="MaSach" />
        <asp:BoundField DataField="SL" HeaderText="SL" SortExpression="SL" />
        <asp:BoundField DataField="DonGia" HeaderText="DonGia" 
            SortExpression="DonGia" />
        <asp:BoundField DataField="ThanhTien" HeaderText="ThanhTien" 
            SortExpression="ThanhTien" />
        <asp:BoundField DataField="XuLy" HeaderText="XuLy" SortExpression="XuLy" />
    </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
    SelectMethod="GetAllCTHD" TypeName="BussinessObject.CTHDContronller">
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="-1" Name="MaHD" QueryStringField="MaHD" 
            Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
